<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb">
			<li>
				<i class="icon-home home-icon"></i>
				<a href="#">系统首页</a>
			</li>
			<li class="active">
				加油站管理
			</li>
			<li class="active">
				加油站列表
			</li>
            <li class="active">
				活动列表
			</li>
		</ul><!-- .breadcrumb -->
	</div>
	<!-- Main content -->
	<div class="page-content">
    	<div class="row">
    	    <div class="page-header">
    			<h1>活动列表</h1>
    		</div>
    		<div class="col-md-12 col-sm-12 col-xs-12 form">
            	<a class="btn btn-info btn-sm" href="<?php echo base_url()."admin/gasstation/add_activity/".$gasstation_id?>"><i class="icon-copy"></i>新增</a>
                <a class="btn btn-sm" href="<?php echo base_url()."admin/gasstation/index"?>"><i class="icon-undo"></i>返回</a>
			</div>
            <div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive  tab">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th>活动信息</th>
                                <th style="width: 10%">发布状态</th>
                                <th style="width: 10%">审核状态</th>
                                <th style="width: 20%">创建时间</th>
                                <th style="width: 30%">操作</th>
							</tr>
						</thead> 
						<tbody>
						<?php if (isset($result)&&count($result)>0){
                            	foreach ($result as $activity){
                            	?>
							<tr>
                                <td><p><?php echo $activity->activity_name;?></p></td>
                                <td><p><?php if ($activity->status=='0')echo '未发布';else if ($activity->status=='1')echo '进行中'?></p></td>
                                <td><p><?php if ($activity->check_status=='0')echo '审核中';else if ($activity->check_status=='1')echo '审核通过';elseif ($activity->check_status=='2')echo '审核拒绝'?></p></td>
                                <td><p><?php echo $activity->create_time;?></p></td>
                                <td>
                                <?php if ($activity->check_status=='0'){?>
                                <a href="<?php echo base_url()."admin/gasstation/activity_check/".$gasstation_id."/".$activity->id.'/1'?>" class="btn btn-info btn-sm"><i class="icon-edit"></i>审核通过</a>
                                <a href="<?php echo base_url()."admin/gasstation/activity_check/".$gasstation_id."/".$activity->id.'/2'?>" class="btn btn-warning btn-sm"><i class="icon-edit"></i>审核拒绝</a>
                                <?php }?>
                                <a href="javascript:void(0)" onclick="delmodal('<?php echo $activity->id;?>')" data-toggle="modal" class="btn btn-danger btn-sm"><i class="icon-trash"></i>删除</a>
                                </td>
    						</tr>
    						<?php }
                            }else{?>
                            <tr>
                            	<td colspan="14">无数据</td>
                            </tr>
                         <?php }?>
                         </tbody>
                     </table>
            	</div><!-- /.table-responsive -->
			</div>
			<div class="col-sm-12">
				<div class="modal-footer no-margin-top">
	            	<div class="pull-left record">
							共<?php echo count($result);?>条记录
	            	</div>
            	</div>
        	</div>
		</div><!-- /.row -->
	</div><!-- /.page-content -->
</div><!-- /.main-content -->
<div id="delModal" class="modal fade" role="dialog" aria-hidden="true">
	<div class="modal-dialog" style="width: 300px">
		<div class="modal-content">
			<div class="modal-header">
			  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			  <h3>提示信息</h3>
			</div>
			<div class="modal-body">
			  <p>确定要删除该活动吗？</p>
			</div>
			<div class="modal-footer">
			  <a id="delbtn" href="#" class="btn btn-danger">确定</a>
			  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
			</div>
		</div>
	</div>
</div>	
<script>
function delmodal(id){
	$("#delbtn").attr('href','<?php echo base_url().'admin/gasstation/del_activity/'.$gasstation_id.'/'?>'+id);
    $('#delModal').modal('show');
}
</script>